package UMC.Web;

public class UIOcrDialog extends UIDialog {

    public UIOcrDialog(int type) {
        super();
        this.config.put("OcrType", type);
    }

    @Override
    protected String type() {
        return "Ocr";
    }

    public UIOcrDialog setCropPortrait(boolean value) {

        if (value) {
            this.config.put("CropPortrait", true);
        } else {

            this.config.remove("CropPortrait");
        }
        return this;

    }

    public UIOcrDialog setCropIdCard(boolean value) {

        if (value) {
            this.config.put("CropIdCard", true);
        } else {

            this.config.remove("CropIdCard");
        }
        return this;

    }

    public UIOcrDialog setBorderCutImage(boolean value) {

        if (value) {
            this.config.put("BorderCutImage", true);
        } else {

            this.config.remove("BorderCutImage");
        }
        return this;

    }

    public void setOcrType(int ocrType) {
        this.config.put("OcrType", ocrType);
    }

    public UIOcrDialog setLandscape(boolean value) {

        if (value) {
            this.config.put("IsLandscape", true);
        } else {

            this.config.remove("IsLandscape");
        }

        return this;
    }

    public UIOcrDialog setManual(boolean value) {

        if (value) {
            this.config.put("IsManual", true);
        } else {

            this.config.remove("IsManual");
        }

        return this;
    }

}
